<h2>Sign up</h2>

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
  <%= devise_error_messages! %>

  <div><%= f.label :name %>
  <%= f.text_field :name %></div>

  <div><%= f.label :email %>
  <%= f.text_field :email %></div>

  <div><%= f.label :hometown %>
  <%= f.text_field :hometown %></div>

  <div><%= f.label :password %>
  <%= f.password_field :password, :onchange => "if $('user[password]').length < 4 { alert('Min 4 caracters !'); }" %></div>

  <div><%= f.label :password_confirmation %>
    <%= f.password_field :password_confirmation %></div>

    <div><%= f.submit "Sign up" %></div>
<% end %>

<%= render :partial => "devise/shared/links" %>
